package com.tbit.uqbike.client.service.impl;

import com.tbit.uqbike.client.dao.core.DispatchLogDao;
import com.tbit.uqbike.client.pojo.DispatchLog;
import com.tbit.uqbike.client.service.DispatchLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("dispatchLogService")
public class DispatchLogServiceImpl implements DispatchLogService {
    @Autowired
    private DispatchLogDao dispatchLogDao;

    @Override
    public void insert(DispatchLog dispatchLog) {
        if (!dispatchLog.isPay()) {
            //未支付设置为一个其他时间，因为数据库表不允许字段为空
            dispatchLog.setReturnTime("1990-01-01 00:00:00");
        }
        dispatchLogDao.insert(dispatchLog);

    }

}  